<?php
namespace PsiFramework\Classes\Util\Database\Query;

import("Classes.Util.Database.Query.SqlIndex");

use \PsiFramework\Classes\Util\Database\Query\SqlColumn;
use \PsiFramework\Classes\Util\Database\Query\SqlIndex;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * The SqlForeignKey class allows to represent a sql foreign key
 *
 * @package classes.util.xpersist.sql
 */
class SqlForeignKey extends SqlIndex
{

    protected /*SqlColumn*/ $_reference ;

    /**
     * SqlForeignKey constructor
     *
     * @param $columns    the columns
     * @param $name        the name of the index
     */
    public function __construct(
        SqlColumn $column=null,
        SqlColumn $reference=null,
        /*string*/ $name=null
    )
    {
        $columns = array();
        $columns[0] = $column ;
        parent::__construct($columns, $name);
        $this->_reference = $reference ;
    }

    public function setReference(SqlColumn $reference)
    {
        $this->_reference = $reference ;
    }

    public function getReference()
    {
        return $this->_reference ;
    }
}

